import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/Layout.vue'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import NotFound from '../views/404.vue'
import Forbidden from '../views/403.vue'
Vue.use(VueRouter)

export const routerz = [
  {
  path: '',
  name:"Layout",
  redirect:'/home',
  component: Layout,
  meta:{
    requiresAuth:true
  },
  children:[
    {
      path:'/home',
      name:'Home',
      component:Home
    }
    ]
},
{
  path:'/403',
  component:Forbidden
},{
  path:'*',
  component: NotFound
}]
const routes = [
  {
    path:'/login',
    name:'Login',
    component :Login
  }
]

const router = new VueRouter({
  routes,
  mode:'history'
})

export default router
